import { dateFormat } from '@/util/date';
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01';
let now = new Date();
now.setDate(now.getDate() + 1);
export const endDate = dateFormat(now, 'yyyy-MM-dd');
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  dialogWidth: '70%',
  printBtn: false,
  showClomnuBtn: false,
  searchSize: 'mini',
  addBtn: false,
  menu: true,
  viewBtn: false,
  editBtn: false,
  delBtn: false,
  menuWidth: 100,
  searchLabelWidth: 100,
  searchMenuSpan: 6,
  labelWidth:"28%",
  column: [{
    label: '标识',
    prop: 'id',
    hide: true,
    display: false
  }, {
    width:160,
    label: '出/入库单号',
    prop: 'outputOrInputStockno',
    //display: false 20250430
	addDisplay: false
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
	//dicUrl: '/support/swpmticketcardtype/dict/ticket',	
    //props: {
    //    label: 'mainName',
    //    value: 'mainEnName'
    //  },
	formatter:function(row, value , label, column){
		 
		 if(value='DCP'){
		   return "单程票";	
		 }
		 if(value='YXCP'){
		   return "营销车票";	
		 }
		 if(value='GWP'){
		   return "公务票";	
		 }
		 if(value='YJZP'){
		   return "应急纸票";	
		 }       
    },
	dicData: [{
          label: '单程票',
          value: 'DCP'
        },{
          label: '营销车票',
          value: 'YXCP'
        },{
          label: '公务票',
          value: 'GWP'
        },{
          label: 'YJZP',
          value: '应急纸票'
        }],
    hide: true,
    disabled: true
  }, {
    width:160,
    label: '车票名称',
    prop: 'ticketName',
    search: true,
    type: 'select',
    props: {
      label: 'subName',
      value: 'subEnName'
    },
    dicUrl: '/support/swpmticketcardtypeparam/dict',
    rules: [{
      required: true,
      message: '请选择车票名称',
      trigger: 'blur'
    }],
    disabled: true
  }, {
    label: '数量',
    prop: 'storageNumber',
    addDisplay: false,
    //editDisplay: false
  }, {
    label: '结存数量',
    prop: 'settleNumber',
    addDisplay: false,
    //editDisplay: false
  }, {
    width:160,
    type: 'select',
    label: '库区',
    prop: 'stockArea',
    props: {
      label: 'ticketAreaName',
      value: 'ticketAreaCode'
    },
    dicUrl: 'support/swpmticketarea/dict',
    search: true,
    disabled: true
  }, {
    width:160,
    label: '出入库类型',
    prop: 'storageType',
    type: 'select',
    search: true,
    addDisplay: false,
    editDisplay: false,
    dicData: [{
      label: '入库',
      value: '入库'
    }, {
      label: '出库',
      value: '出库'
    }],
    disabled: true
  }, {
    width:160,
    label: '出入库方式',
    prop: 'outInGoingType',
    disabled: true
  }, {
    width:160,
    label: '出入库时间',
    prop: 'outInGoingTime',
    type: 'datetime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    disabled: true,
    search: true,
    searchValue: [startDate, endDate],
    searchSpan: 12,
    searchRange: true,
	editDisplay: false
  }, {
    label: '出入库时间',
    prop: 'outInGoingTimeEdit',
    type: 'datetime',
    format: 'yyyy-MM-dd HH:mm:ss',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    addDisplay:false,
	editDisplay: true,	
    hide:true
  }, {
    width:160,
    label: '车票有效期',
    prop: 'activeTime',
    disabled: true
  }, {
    width:160,
    label: '车票最晚启动日期',
    prop: 'latestStartTime',
    type: 'datetime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    disabled: true
  }, {
    width:160,
    label: '库管员1工号',
    prop: 'keeper1code',
    disabled: true
  }, {
    label: '库管员1',
    prop: 'keeper1name',
    disabled: true
  }, {
    width:160,
    label: '库管员2工号',
    prop: 'keeper2code',
    disabled: true
  }, {
    label: '库管员2',
    prop: 'keeper2name',
    disabled: true
  }, {
    label: '起止号',
    prop: 'ticketNo',
    disabled: true
  }, {
    label: '车票次数',
    prop: 'ticketTimes',
    disabled: true
  }, {
    label: '车票金额',
    prop: 'ticketPrice',
    type: 'number',
    precision: 2,
    disabled: true
  }, {
    label: '备注',
    prop: 'remark',
    type: 'textarea',
    maxRows: 6,
    minRows: 4,
    span: 24,
    hide: true
  }, {
    label: '创建人ID',
    prop: 'creatorId',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '创建人名称',
    prop: 'creatorName',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '记录时间',
    prop: 'createTime',
    type: 'datetime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    addDisplay: false,
    editDisplay: false,
  }]
};
